#include "TestGame.h"
#include "Shape.h"

TestGame::TestGame (HINSTANCE hInstance) 
:
Game(hInstance)
{

}

TestGame::~TestGame()
{

}

bool TestGame::OnStartUp()
{
	ns::Importer* pkImporter = getImporter();

	pkImporter->LoadResources("../../res/sprite.xml");




	triangle = new ns::Triangle();
	triangle->setPosition(0.5f,0.5f);
	triangle->setScale(1.5f,1.5f);
	triangle->setColor(0,255,0);
	triangle->setRotation(90);
	addEntity(triangle);

	box = new ns::Box();
	box->setPosition(0.5f,-0.5f);
	box->setScale(2.0f,3.5f);
	box->setColor(0,0,255);
	box->setRotation(45);
	addEntity(box);

	triangle1 = new ns::Triangle();
	triangle1->setPosition(-0.5f,-0.5f);
	triangle1->setScale(4.5f,3.0f);
	triangle1->setColorVertexTriangle(0,255,0,0);
	triangle1->setColorVertexTriangle(1,0,255,0);
	triangle1->setColorVertexTriangle(2,0,0,255);
	triangle1->setRotation(0);
	addEntity(triangle1);

	box1 = new ns::Box();
	box1->setPosition(-0.5f,0.5f);
	box1->setScale(4.0f,4.0f);
	box1->setColorVertexBox(0,255,0,255);
	box1->setColorVertexBox(1,0,255,255);
	box1->setColorVertexBox(2,255,255,0);
	box1->setColorVertexBox(3,255,255,255);
	box1->setRotation(0);
	addEntity(box1);

	circle = new ns::Circle(7);//numero de caras
	circle->setPosition(0,0);
	circle->setScale(0.5f,0.5f);
	circle->drawCircle();
	circle->setColor(255,0,0); //set color dsps del draw
	addEntity(circle);

		// initialize pacman
	if( pkImporter->CreateSprite("Snowbros", m_pkPacman) )
	{
		// set properties
		m_pkPacman->setName("el pacman loco");
		m_pkPacman->setScale(50,50);
		m_pkPacman->setPosition(0,0);
		/*
		// set animation
		if( m_pkPacman->setAnimation("Eat") )
			m_pkPacman->getAnimation()->play();
	*/
		// add it to the scene
		addEntity(m_pkPacman);
	}

	// initialize ghost
	if( pkImporter->CreateSprite("Humo", m_pkGhost1) )
	{
		// set properties
		m_pkGhost1->setName("el fantasma loco");
		m_pkGhost1->setScale(50,50);
		m_pkGhost1->setPosition(0,0);

		addEntity(m_pkGhost1);
	}

	return true;
}

bool TestGame::OnLoop()
{
	return false;
}

bool TestGame::OnShutDown()
{
	return false;
}
